

/**
 *
 *
 * API:
 * ---------------
 * getBPMObjectType()
 * getPartyId()
 * fromXML(xmlDoc)
 * getPartyType()
 * getPartyId()
 */
(function(global){
    'use strict';
    const logger = WorkflowUtil.newLogger("WorkflowApp/BPMActor");

    const CONDITION_AND = 0;
    const CONDITION_OR = 1;
    const CONDITION_NOT = 2;


    let BPMActor = function () {

        BPMActor.__super__.constructor.apply(this, arguments);

        this.addAttr("roleId", "", "k");
        this.addAttr("condition", CONDITION_AND, "c");
        this.addAttr("isConstant", "", "j");
        this.addAttr("includeChild", "true", "i");
        this.addAttr("partyId", "", "f");
        this.addAttr("partyType", "", "g");
        this.addAttr("partyIncludeChild", "true", "h");
        this.addAttr("name", "", "d");
        this.addAttr("shortName", "", "a", true);
        this.addAttr("addition", "", "l");
        this.addAttr("raddition", "", "m");
        this.addAttr("partyAccountId", "", "b");
        this.addAttr("partyVJoin", "", "vj");
    };
    //继承
    WorkflowUtil.extend(BPMActor, global.BPMObject);

    BPMActor.prototype.getPartyId = function(){
      return this.getAttr("partyId");
    };

    BPMActor.prototype.getBPMObjectType = function(){
        return WorkflowConstant.bpmObjType.BPMActor;
    };

    BPMActor.prototype.fromXML = function(xmlDoc){

        this.transXMLNode2BPMObject(xmlDoc);
    };

    BPMActor.prototype.toXML = function(node, docRoot){

        const aNode = docRoot.createElement("a");
        node.appendChild(aNode);
        this.parseAttr2Node(aNode);
    };

    BPMActor.prototype.getPartyType = function(){
        return this.getAttr("partyType");
    };

    BPMActor.prototype.getPartyId = function(){
        return this.getAttr("partyId");
    };

    global.BPMActor = BPMActor;

})(WorkflowApp);
